<script>
    import Chat from './MessagePage.svelte'
    import Userlist from './SendPage.svelte'
    import  Header from './head.svelte'
    import Fileupload from './fileupload.svelte'

    import {onMount} from "svelte";
    import {setlogin, setuser} from "../src/main.js";
    import {push} from "svelte-spa-router";

    onMount(
        async ()=>{
            // await fetch("/api/login",{
            //
            // }).then((r)=>{
            //     return r.json()
            // }).then((res)=> {
            //     if(res.status===0){
            //         setlogin()
            //         setuser()
            //     }else{
            //         alert("请先登录")
            //         push("/")
            //     }
            //     console.log(res)
            // }
            // )
        }
    )

</script>

<main style="display: flex;justify-content: flex-start;">
    <!--    <header></header>-->
    <Chat></Chat>
    <Userlist></Userlist>
</main>


<svelte:head>
    <!-- Fonts -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700">

    <!-- Material Typography -->
    <link rel="stylesheet" href="https://unpkg.com/@material/typography@14.0.0/dist/mdc.typography.css" />

    <!-- SMUI -->
    <link rel="stylesheet" href="https://unpkg.com/svelte-material-ui/bare.css" />
</svelte:head>